package com.zmzncs.lmtc.module.customer.pojo.cust_ticket;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author 任建波
 * @since 2020-10-09
 */
@Data
public class CustTicketGrantForm implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "发放类型，1.单人 2.群体", required = true)
    @NotNull
    private Integer grantType;

    @ApiModelProperty(value = "会员ID集合")
    private List<Long> customerIds;

    @ApiModelProperty(value = "会员类型，0.潜在会员 1.正式会员 2.不限")
    private Integer memberType;

    @ApiModelProperty(value = "发放时间", required = true)
    @NotBlank
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date grantTime;

    @ApiModelProperty(value = "发放的优惠券", required = true)
    @NotNull
    private List<TicketInfo> ticketList;

    @Data
    public static class TicketInfo {

        @ApiModelProperty(value = "优惠券ID", required = true)
        @NotNull
        private Long ticketId;

        @ApiModelProperty(value = "使用类型，1.通用 2.时长 3.月租 4.充值")
        private Integer useType;

        @ApiModelProperty(value = "有效期天数")
        private Integer expiryDays;

        @ApiModelProperty(value = "发放数量", required = true)
        @NotNull
        private Integer count;

    }

}
